package com.ruoyi.wechat.service.impl;

import java.util.List;

import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.wechat.mapper.ScenicSpotsMapper;
import com.ruoyi.wechat.domain.ScenicSpots;
import com.ruoyi.wechat.service.IScenicSpotsService;

/**
 * 营地周边景点表Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-29
 */
@Service
public class ScenicSpotsServiceImpl implements IScenicSpotsService 
{
    @Autowired
    private ScenicSpotsMapper scenicSpotsMapper;

    /**
     * 查询营地周边景点表
     * 
     * @param scenicId 营地周边景点表主键
     * @return 营地周边景点表
     */
    @Override
    public ScenicSpots selectScenicSpotsByScenicId(String scenicId)
    {
        return scenicSpotsMapper.selectScenicSpotsByScenicId(scenicId);
    }
    @Override
    public ScenicSpots selectScenicSpotsBycampId(String campId)
    {
        return scenicSpotsMapper.selectScenicSpotsBycampId(campId);
    }


    /**
     * 查询营地周边景点表列表
     * 
     * @param scenicSpots 营地周边景点表
     * @return 营地周边景点表
     */
    @Override
    public List<ScenicSpots> selectScenicSpotsList(ScenicSpots scenicSpots)
    {
        return scenicSpotsMapper.selectScenicSpotsList(scenicSpots);
    }

    /**
     * 新增营地周边景点表
     * 
     * @param scenicSpots 营地周边景点表
     * @return 结果
     */
    @Override
    public String insertScenicSpots(ScenicSpots scenicSpots)
    {

        scenicSpots.setScenicId(IdUtils.randomUUID());
        scenicSpotsMapper.insertScenicSpots(scenicSpots);
        return scenicSpots.getScenicId();
//        return scenicSpotsMapper.insertScenicSpots(scenicSpots);
    }

    /**
     * 修改营地周边景点表
     * 
     * @param scenicSpots 营地周边景点表
     * @return 结果
     */
    @Override
    public int updateScenicSpots(ScenicSpots scenicSpots)
    {
        return scenicSpotsMapper.updateScenicSpots(scenicSpots);
    }

    /**
     * 批量删除营地周边景点表
     * 
     * @param scenicIds 需要删除的营地周边景点表主键
     * @return 结果
     */
    @Override
    public int deleteScenicSpotsByScenicIds(String[] scenicIds)
    {
        return scenicSpotsMapper.deleteScenicSpotsByScenicIds(scenicIds);
    }

    /**
     * 删除营地周边景点表信息
     * 
     * @param scenicId 营地周边景点表主键
     * @return 结果
     */
    @Override
    public int deleteScenicSpotsByScenicId(String scenicId)
    {
        return scenicSpotsMapper.deleteScenicSpotsByScenicId(scenicId);
    }
}
